package Pattern.FactoryPattern.Car;

/**
 * @Author MJS
 * @Date 2021/8/4 11:38
 * @Description
 * 超级工厂类  ，建造工厂的工厂
 */
public class FactoryProducer {
    public static AbstractFactory getFactory(String type) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Class cl = Class.forName(type);
        System.out.println("创建工厂"+type);
        return (AbstractFactory)cl.newInstance();
    }
}
